package com.wesley.netty.clazz;

/**
 * TestClass
 *
 * @author WangPanYong
 * @since 2020/09/29 10:22
 */
public class TestClass {
    private int id;

    private String desc;

    public int inc() {
        return id + 1;
    }

    public void sout() {
        System.out.println(" ========> TestClass.sout() ...");
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static void main(String[] args) {
        String str2 = new StringBuilder("计算机").append("技术").toString();   //没有出现"计算机技术"字面量，所以不会在常量池里生成"计算机技术"对象
        System.out.println(str2 == str2.intern());  //true

        String str1 = new StringBuilder("ja").append("va").toString();    //没有出现"java"字面量，所以不会在常量池里生成"java"对象
        System.out.println(str1 == str1.intern());  //false

        Integer i1 = 127;
        Integer i2 = 127;
        System.out.println(i1 == i2);//输出true

        Integer i3 = 128;
        Integer i4 = 128;
        System.out.println(i3 == i4);//输出false
    }
}
